﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Chart.aspx.cs" Inherits="WebAccess.Chart" %>
<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" 
        EnablePageMethods="True">
    </asp:ToolkitScriptManager>
    
    <asp:Accordion ID="Accordion1" runat="server"
    CssClass = "accordion"
   HeaderCssClass = "accordionHeader"
   HeaderSelectedCssClass="accordionHeaderSelected"
   ContentCssClass = "accordionContent" Width="90%"
    
    >
    <Panes>
    <asp:AccordionPane ID = "ControlPane" runat = "server"> 
    <Header>
    Select your Sensor
    </Header>
    <Content>
    <table>
    <tr>
    <td>
    Choose your Sensor
    </td>
        
    <td>
    <asp:DropDownList ID="DropDownList1" runat="server">
        </asp:DropDownList>
    </td>
    </tr>
    <tr>
    <td>
    <asp:Button ID="Button1" runat="server" Text="Button" />
    </td>
    </tr>
    </table>
        
    
    
    </Content>
    
    </asp:AccordionPane>

    <asp:AccordionPane ID = "ChartSpace" runat = "server" Visible = "false">
    
    <Header>
    Chart
    </Header>
<Content>

<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" Width = "700">
        <series>
            <asp:Series Name="Series1" XValueMember="reading_date" 
                YValueMembers="sensor_reading">
            </asp:Series>
        </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </chartareas>
    </asp:Chart>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:sensorsConnectionString %>" 
        SelectCommand="SELECT * FROM [Reading]"></asp:SqlDataSource>
</Content>    
    </asp:AccordionPane>
    
    </Panes>
    </asp:Accordion>
</asp:Content>
